package com.example.kakaofragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class FragmentFour extends Fragment {

	EditText idView;
	EditText pwView;
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		
		View v = inflater.inflate(R.layout.shared_activity, container, false);
		
		idView = (EditText)v.findViewById(R.id.editText1);
		pwView = (EditText)v.findViewById(R.id.editText2);
		Button btn = (Button)v.findViewById(R.id.button1);
		btn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				User user = new User();
				user.id = idView.getText().toString();
				user.pw = pwView.getText().toString();
				PropertyManager.getInstance().setUser(user);
			}
		});
		User user = PropertyManager.getInstance().getUser();
		idView.setText(user.id);
		pwView.setText(user.pw);
		
		return v;
	}
	
}
